package Animal;

class Cat extends Animal{
    public void eat(){
        System.out.println(this.name + "正在吃狗粮");
    }
}

class Dog extends Animal{
    public int age = 10;
    public void sleep(){
        System.out.println(super.age + "岁的" + this.name + "正在睡觉");
    }


    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "小黑";
        dog.sleep();
    }
}

class Animal{
    public String name;
    public int age = 1;

    public void sleep(){
        System.out.println(this.name + "正在睡觉");
    }
}
public class Test {

    public static void main(String[] args) {
        Dog dog = new Dog();
        System.out.println(dog.age);
    }
}
